<?php
/**
 * append.php - Append (authenticated)
 *
 * @category   babel
 * @package    BABEL
 * @author     Magnus Jonsson <magnus.jonsson@codealliance.se>
 * @author     Hannes Magnusson <hannes.magnusson@gmail.com>
 * @copyright  2008 Team Babel
 * @since      Milestone 0.1
 */

if (defined("BABEL_DEFAULT_ERRMSG")) {
	Babel_Error_Logger::push($_SESSION);
}
$debug_output = '<h2>DEBUG OUTPUT</h2><pre class="debug">'. "\n";
if (defined("BABEL_DEFAULT_ERRMSG")) {
	$debug_output .= implode("\n", Babel_Error_Logger::fetch());
} else {
	$debug_output .= var_export($_SESSION, true);
}
$debug_output .= '</pre>';


$google_analytics_code = _ICE_GOOGLE_ANALYTICS_CODE;

$google_analytics = "<script type=\"text/javascript\">
var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");
document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));
</script>
<script type=\"text/javascript\">
var pageTracker = _gat._getTracker(\"$google_analytics_code\");
pageTracker._initData();
pageTracker._trackPageview();
</script>";

$obj_tpl->setFile('footer','babel/footer.html');
$obj_tpl->setVar(array(
		'VAR_VERSION' 			=> _ICE_BABEL_VERSION.' (Babel)',
		'VAR_DEBUG_OUTPUT'		=>  (!isLive())?$debug_output:'',
		'VAR_CURRENT_YEAR'		=> date("Y",time()),
		'VAR_GOOGLE_ANALYTICS'	=> ($google_analytics_code)?$google_analytics:''
		));
$obj_tpl->parse('footer','footer');
$obj_tpl->p('footer');

